﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.IO;
using ESRI.ArcGIS.ADF.BaseClasses;
using PlanningGIS.Engine.Controls;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.DataSourcesFile;
using PlanningGIS.Framework;
//using PlanningGIS.ADF.BaseClasses;
using ESRI.ArcGIS.DataSourcesRaster;
//using ESRI.ArcGIS.Analyst3D;
using ESRI.ArcGIS.esriSystem;

namespace PlanningGIS.DataConvert.button
{
    
    internal class RasterDataImportButton : BaseTool
    {
        IApplication m_Application = null;
        public RasterDataImportButton()
        {
            base.m_caption = "栅格数据入库";
            base.m_toolTip = base.Caption;
        }

        public override void OnCreate(object hook)
        {
            m_Application = hook as IApplication;
        }

        public override void OnClick()
        {
            ////frmRasterMosaic myform = new frmRasterMosaic();
            //frmRasterCatalogImp myform = new frmRasterCatalogImp();
            //myform.Application = m_Application;
            //myform.Show((m_Application as IFramework).MdiForm);

            frmImpRaster frm = new PlanningGIS.DataConvert.frmImpRaster();
            frm.Application = m_Application;
            frm.Show((m_Application as IFramework).MdiForm);
        }
        public override int Bitmap
        {
            get
            {
                string bitmapResourceName = this.GetType().Namespace + ".Res." + this.GetType().Name + ".png";
                return new Bitmap(GetType().Assembly.GetManifestResourceStream(bitmapResourceName)).GetHbitmap().ToInt32();
            }
        }
        public override bool Enabled
        {
            get
            {
                return (m_Application as IFramework).IsMapCtrlactive;
            }
        }
    }
}
